app.controller("z-restVacation-c", [ '$scope','$rootScope','$z-http','$sce','z-restVacation-s','z-attendance-s','z-edit-menu-s','$filter',
		function($scope,$rootScope,$zhttp,$sce,Service,AttendanceService,MenuService,$filter) {
		$scope.viewModel = {};
		$scope.viewModel.restVacation="";

		$scope.editModel = {};
		$scope.editModel.title="";
		
		//查询页面名称
		MenuService.getMenuByUrl({url:'restVacation'},
		function(data){	
			$scope.viewModel.menuList=data;
		},function(error) {});
		
		//加载考勤状态数据
		$scope.viewModel.bindSelectData = function(){
			Service.getRestVacationList({
			},
			function(data){
				$scope.viewModel.dataList = data;
			},function(error) {
						
			});
		};
		$scope.viewModel.bindSelectData();
		
		//加载
		$scope.viewModel.load=function(){
			$scope.viewModel.show=true;
		};
		//关闭加载
		$scope.viewModel.unLoad=function(){
			$scope.viewModel.show=false;
			$scope.editModel.user={};
		};
		
		$scope.viewModel.checkGlobal=function(){
			return false;
		};
		
		// 将分钟数量转换为小时和分钟字符串
		$scope.viewModel.toHourMinute=function(minutes){
			if(minutes==null){
				return "";
			}
			return (Math.floor(minutes/60).toFixed(0) + "小时" + Math.floor(minutes%60).toFixed(0) + "分钟" );
		};
} ]);